//
//  BDPaySuccessViewController.m
//  BeidouMall
//
//  Created by qie on 16/4/18.
//  Copyright © 2016年 qie. All rights reserved.
//

#import "BDPaySuccessViewController.h"
#import "BDNavigationController.h"
#import "BDOrderHomeViewController.h"

@interface BDPaySuccessViewController ()

@property (weak, nonatomic) IBOutlet UIImageView *imageView;
@property (weak, nonatomic) IBOutlet UILabel *msgLabel;
@property (weak, nonatomic) IBOutlet UIButton *confirmButton;


@end

@implementation BDPaySuccessViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = NSLocalizedString(@"Pay result", nil);
    
    self.confirmButton.layer.cornerRadius = 6.0;
    self.confirmButton.layer.borderColor = [RGBColor(42, 42, 42) CGColor];
    self.confirmButton.layer.borderWidth = 1.0;
    if ([_type isEqualToString:@"success"]) {
        self.imageView.image = [UIImage imageNamed:@"paySuccess"];
        self.msgLabel.text = NSLocalizedString(@"Pay successful", nil);
    } else {
        self.imageView.image = [UIImage imageNamed:@"payFail"];
        self.msgLabel.text = NSLocalizedString(@"Pay failed", nil);
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (IBAction)confirmButtonPressed:(UIButton *)sender {
    [BDAccountManagerModel shareInstance].payResult = @"popToRoot";
    [self dismissViewControllerAnimated:YES completion:nil];
}


/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
